Actually commit the 1.4.1 change to the Mac object build.
authorrobertl <robertl>
Tue, 29 Jun 2010 01:28:35 +0000 (01:28 +0000)
committerrobertl <robertl>
Tue, 29 Jun 2010 01:28:35 +0000 (01:28 +0000)
tools/mac-localize
tools/skeleton-locversion-plist [new file with mode: 0644]

index 96a250aecf0a5bec009e946ab3566807ac3d86e1..25fcebea3f2329932d69e69024e07b442381fe6f 100755 (executable)
@@ -1,12 +1,25 @@
-# Creating even empty (?!?!) directories is enough to trigger the merge
-# of the trnslations for the application menu.  This isn't as ambitious
-# as described at 
+# Create locversion.plist in the bundle to trigger translations for 
+# the application menu and system buttons.  See description at
 # http://doc.qt.nokia.com/4.6/mac-differences.html#translating-the-application-menu-and-native-dialogs
-# but at least for German, it seems to work.
-#
+
+QTDIR=/Developer/Applications/Qt/translations/
+LANGDIR=objects/GPSBabelFE.app/Contents/MacOS/lang
+
+
+mkplist() {
+  D=objects/GPSBabelFE.app/Contents/Resources/$1.lproj 
+  [ ! -d $D ] && mkdir $D
+  sed "s/LANGUAGE/$1/" ../tools/skeleton-locversion-plist > $D/locversion.plist
+  # optional as en, it, and hu aren't translated in Qt yet.
+  [ -f $QTDIR/qt_$1.qm ] && cp $QTDIR/qt_$1.qm $LANGDIR
+  [ -f gpsbabelfe_${1}.qm ] && cp gpsbabelfe_${1}.qm  $LANGDIR
+}
 
 cd gui 
+[ ! -d $LANGDIR ] && mkdir $LANGDIR
 for i in $(echo  gpsbabelfe_??.ts | sed 's/gpsbabelfe_\(..\).ts/\1/g')
 do
-  mkdir objects/GPSBabelFE.app/Contents/Resources/$i.lproj 
+       mkplist $i
 done
+
+mkplist en
diff --git a/tools/skeleton-locversion-plist b/tools/skeleton-locversion-plist
new file mode 100644 (file)
index 0000000..0b71e7c
--- /dev/null
@@ -0,0 +1,15 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
+ "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+     <key>LprojCompatibleVersion</key>
+     <string>123</string>
+     <key>LprojLocale</key>
+     <string>LANGUAGE</string>
+     <key>LprojRevisionLevel</key>
+     <string>1</string>
+     <key>LprojVersion</key>
+     <string>123</string>
+ </dict>
+ </plist>